import Cookies from 'js-cookie'

const TokenKey = 'TokenKey'
const UserInfoKey = 'UserInfoKey'
const Statuskey = 'STATUS'

export function getToken() {
  return Cookies.get(TokenKey)
}

export function setToken(token) {
  return Cookies.set(TokenKey, token)
}

export function removeToken() {
  return Cookies.remove(TokenKey)
}
export function getUserInfo() {
  return JSON.parse(sessionStorage.getItem(UserInfoKey))
}

export function setUserInfo(UserInfo) {
  return sessionStorage.setItem(UserInfoKey, JSON.stringify(UserInfo))
}

export function removeUserInfo() {
  return sessionStorage.removeItem(UserInfoKey)
}

export function getStatus() {
  return JSON.parse(sessionStorage.getItem(Statuskey))
}

export function setStatus(status) {
  return sessionStorage.setItem(Statuskey, JSON.stringify(status))
}

export function removeStatus() {
  return sessionStorage.removeItem(Statuskey)
}
